package com.jsb.laundry.dao;

import com.jsb.laundry.model.entity.BankInfo;
import com.jsb.laundry.model.entity.CapitalAccount;
import com.jsb.laundry.model.entity.CapitalAccountUnstLog;
import com.jsb.laundry.model.entity.Withdrawals;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface WithdrawalDao {
    /**
     * 添加操作记录表
     * @param capitalAccountUnstLog
     * @return
     */
    int addCapitalAccountUnstLog(CapitalAccountUnstLog capitalAccountUnstLog);



    /**
     * 查询用户可提现金额
     * @param userId
     * @return
     */
    int findByDeposit(String userId);

    /**
     * 查询账号资金表信息
     * @param thirdpartId
     * @param type
     * @return
     */
    CapitalAccount capitalAccountInfo(@Param("thirdpartId")String thirdpartId, @Param("type") String type);

    /**
     * 根据提现单号查询提现金额
     * @param number
     * @return
     */
    Withdrawals findByWithdrawalLogMoney(String number);

    /**
     * 骑手提现扣除可提现金额
     * @param amount
     * @param id
     * @return
     */
    int updateDepositSub(@Param("amount")int amount,@Param("id")String id);

    /**
     * 根据用户id查询银行卡信息
     * @param userId
     * @return
     */
    BankInfo findByRiderBankInfo(String userId);

    /**
     * 公司账户扣除金额
     * @param amount
     * @param id
     * @return
     */
    int systemOut(@Param("amount")int amount,@Param("id")String id);

    /**
     * 公司账户加金额
     * @param amount
     * @param id
     * @return
     */
    int systemIn(@Param("amount")int amount,@Param("id")String id);

    /**
     * 用户提现可提现变成已提现
     * @return
     */
    int userMoney(@Param("amount")int amount,@Param("id")String id);

    /**
     * 可提现扣除，待结算增加
     * @return
     */
    int subDepositAddDepositFreeze(@Param("amount")int amount,@Param("id")String id);
}
